﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Script.Components.Controllers
{
    public class NavigationController
    {
        public Stack<object> BackList { get; set; }
        public Stack<object> ForwardList { get; set; }

        public NavigationController()
        {
            BackList = new Stack<object>();
            ForwardList = new Stack<object>();
        }

        public void AddBack(object data)
        {
            BackList.Push(data);
        }

        public object GetBack()
        {
            var obj = BackList.Pop();
            ForwardList.Push(obj);
            return obj;
        }

        public object GetForward()
        {
            var obj = ForwardList.Pop();
            BackList.Push(obj);
            return obj;
        }
    }
}
